﻿using System.Data.Linq;
using System.Linq;
using SportsStore.Domain.Abstract;
using SportsStore.Domain.Entities;

namespace SportsStore.Domain.Concrete {

  public class SqlProductsRepository: IProductsRepository {

    private readonly Table<Product> productsTable;
    
    public SqlProductsRepository(string connectionString) {
      productsTable = (new DataContext(connectionString)).GetTable<Product>();
    }

    public IQueryable<Product> Products {
      get { return productsTable; }
    }

  }
}
